﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;

namespace NotifyPropertyChangeSample
{
    class ProductManager
    {
        private ObservableCollection<Product> _productsCollection;

        public ObservableCollection<Product> ProductsCollection
        {
            get
            {
                if (_productsCollection == null)
                    _productsCollection = new ObservableCollection<Product>();

                return _productsCollection;
            }
            set { _productsCollection = value; }
        }
        
       

        internal ObservableCollection<Product> GetProducts()
        {
            Product product;

            product = new Product();
            product.ProductId = 100;
            product.ProductName = "Pen";
            ProductsCollection.Add(product);

            product = new Product();
            product.ProductId = 200;
            product.ProductName = "Orange";
            ProductsCollection.Add(product);

            return ProductsCollection;
        }
    }
}
